package org.example;
public class Teacher extends Person {
    private Course taughtCourse;

    public Teacher() {
        super();
    }

    public Teacher(String teacherId, String teacherName, String gender) {
        super(teacherId, teacherName, gender);
    }

    public void openCourse(Course course) {
        this.taughtCourse = course;
        System.out.println(name + " 老师开设了课程：" + course.getCourseName());
    }

    @Override
    public void printWorkOrder() {
        super.printWorkOrder();
        if (taughtCourse != null) {
            System.out.println(name + " 老师的授课信息：");
            System.out.println(taughtCourse);
        } else {
            System.out.println(name + " 老师暂未开设课程");
        }
        System.out.println("------------------------");
    }

    public Course getTaughtCourse() {
        return taughtCourse;
    }

    public void setTaughtCourse(Course taughtCourse) {
        this.taughtCourse = taughtCourse;
    }
}